import 'package:backend.core/core/domain/entities/api/web/api_web_payment_method.dart';
import 'package:backend.core/core/domain/entities/api/web/yookassa/api_yookassa_payment_method.dart';
import 'package:backend.purchases/infrastructure/dtos/api/web/api_web_payment_method_dto.dart';
import 'package:backend.purchases/infrastructure/dtos/api/web/yookassa/api_yookassa_payment_method_dto.dart';

class ApiWebPaymentMethodDtoFactory {
  const ApiWebPaymentMethodDtoFactory._internal();

  static const _instance = ApiWebPaymentMethodDtoFactory._internal();

  factory ApiWebPaymentMethodDtoFactory() {
    return _instance;
  }

  ApiWebPaymentMethodDto fromEntity(ApiWebPaymentMethod paymentMethod) {
    if (paymentMethod is ApiYookassaPaymentMethod) {
      return ApiYookassaPaymentMethodDto.fromEntity(paymentMethod);
    }

    throw UnimplementedError();
  }
}
